From: Giovanni Campagna Date: Sat, 2 Apr 2011 20:27:20 +0000 (+0200) Subject: NetworkMenu: fix handling WWAN devices X-Git-Tag: archive/raspbian/50.5-1+rpi1~1^2~1013^2^2~8354 X-Git-Url: https://dgit.raspbian.org/%22http://www.example.com/cgi/%22/%22http:/www.example.com/cgi/%22?a=commitdiff_plain;h=c7dfd0894ea6db6b1b04f723fae857ebfdf46f4f;p=gnome-shell.git NetworkMenu: fix handling WWAN devices NMDeviceModem._createSection was not checking whether it should have shown the connection list, resulting in status item shown even if the device was in an invalid state. Also, fix a logic error when creating the operatorItem and fix overriding _clearSection protected method. https://bugzilla.gnome.org/show_bug.cgi?id=646395 --- diff --git a/js/ui/status/network.js b/js/ui/status/network.js index 90affc3eb..f76d5bbb3 100644 --- a/js/ui/status/network.js +++ b/js/ui/status/network.js @@ -824,12 +824,15 @@ NMDeviceModem.prototype = { }, _createSection: function() { + if (!this._shouldShowConnectionList()) + return; + if (this.mobileDevice) { // If operator_name is null, just pass the empty string, as the item is hidden anyway this._operatorItem = new PopupMenu.PopupImageMenuItem(this.mobileDevice.operator_name || '', this._getSignalIcon(), { reactive: false }); - if (this.mobileDevice.operator_name) + if (!this.mobileDevice.operator_name) this._operatorItem.actor.hide(); this.section.addMenuItem(this._operatorItem); } @@ -837,7 +840,7 @@ NMDeviceModem.prototype = { NMDevice.prototype._createSection.call(this); }, - clearSection: function() { + _clearSection: function() { this._operatorItem = null; NMDevice.prototype._clearSection.call(this);